package com.markedquilt.comment.coomon;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
public enum EmBussinessError {

    //通用错误类型码
    NO_OBJECT_FOUND(10001,"请求对象不存在"),
    UNKNOW_ERROR(10002,"未知错误"),
    NO_HANDLER_FOUND(10003,"找不到指定的资源路径，404"),
    BIND_EXCEPTION_ERROR(10004,"请求参数错误"),
    PARAMETER_VALIDATION_ERROR(10005,"请求参数校验失败"),

    //用户服务相关的错误类型
    REGISTER_DUP_FAIL(20001,"用户已存在"),
    LOGIN_FAIL(20002,"手机号或密码错误"),

    //管理员相关错误
    ADMIN_SHOULD_LOGIN(30001,"管理员需要先登陆"),

    //品类相关错误
    CATEGORY_NAME_DUPLICATED(40001,"品类名已存在"),
    ;

    private Integer errCode;
    private String errMsg;

    public Integer getErrCode() {
        return errCode;
    }

    public void setErrCode(Integer errCode) {
        this.errCode = errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
